﻿using System;

namespace FluentlyXml.Core.BuiltInSerializers
{
	internal class CustomSerializer : ObjectSerializer
	{
		public Type AppliesToType { get; private set; }

		public CustomSerializer(Type type)
		{
			AppliesToType = type;
		}

		public override bool CanSerialize(Type type)
		{
			return AppliesToType == type;
		}

		public void AddPropertySerializer(string propertyName, PropertySerializer propertySerializer)
		{
			PropertyFactories.Add(propertyName, propertySerializer);
		}
	}
}